<template>
  <div>
    <h2>父组件</h2>
    <p>银子: {{ money }}万元</p>
    <p>车子: {{ car }}</p>
    <Child />
  </div>
</template>

<script lang="ts" setup>
import Child from './child.vue';
import {ref, reactive, provide} from 'vue'
let money = ref(100)
let car = reactive({
  brand: 'LINK&CO',
  price: 100
})
function updateMoney() {
  money.value -= 5
}
provide('moneyContext', { money, updateMoney })
provide('car', car)
</script>

<style lang="scss" scoped>
</style>
